 //1.公用样式
 require('../../assets/css/index.js')
 //当前页面样式
 require('../../lib/swiper/swiper-bundle.css')
 require('./home.less');
    //2.公用js
let dom=require('../../utils/dom.js');
let https=require('../../utils/https.js');
let local=require('../../utils/local.js')
// let uti=require('../../utils/utils.js');
let Swiper=require('../../lib/swiper/swiper-bundle.js')
dom.ready(function(){
    dom.ft('home');
    new Swiper ('.swiper', {
      direction: 'horizontal', // 垂直切换选项
      autoplay: {
        pauseOnMouseEnter:true,
        disableOnInteraction:false,
      },
      loop: true, // 循环模式选项
      
      // 如果需要分页器
      pagination: {
        el: '.swiper-pagination',
      }
    })
    https.get('/api/user/info',function(vla){
      let data=vla.data;
      let {ranking,clockCount,badges}=data;
      ren.innerText=ranking;
      clo.innerText=clockCount;
      bad.innerText=badges;
    })
    let punchCard=dom.getById('#punchCard');
    punchCard.addEventListener('click',function(){
      https.post('/api/user/clockIn',{},function(val){
      if(val.errno==0){
        alert(val.message)
      }else{
        alert(val.message)
      }
    })
    })
 
      
})